package com.heu.blood.charge.controller;

import java.util.Arrays;
import java.util.Map;

import com.heu.blood.charge.vo.BloodChargeHistoryUploadVo;
import com.heu.blood.common.aop.ControllerLogAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.heu.blood.charge.entity.BloodChargeUploadHistoryEntity;
import com.heu.blood.charge.service.BloodChargeUploadHistoryService;
import com.heu.blood.common.utils.PageUtils;
import com.heu.blood.common.utils.R;



/**
 * 计费上传记录表
 *
 * @author lhh
 * @email lhh1612325771@163.com
 * @date 2024-07-19 19:50:22
 */
@RestController
@RequestMapping("charge/bloodchargeuploadhistory")
public class BloodChargeUploadHistoryController {
    @Autowired
    private BloodChargeUploadHistoryService bloodChargeUploadHistoryService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @ControllerLogAnnotation(module = "收费模块", operate = "分页展示所有推送记录信息")
    public R list(BloodChargeHistoryUploadVo bloodChargeHistoryUploadVo){
        PageUtils page = bloodChargeUploadHistoryService.queryPage(bloodChargeHistoryUploadVo);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @ControllerLogAnnotation(module = "收费模块", operate = "按照id查找推送记录信息")
    public R info(@PathVariable("id") Integer id){
		BloodChargeUploadHistoryEntity bloodChargeUploadHistory = bloodChargeUploadHistoryService.getById(id);

        return R.ok().put("bloodChargeUploadHistory", bloodChargeUploadHistory);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @ControllerLogAnnotation(module = "收费模块", operate = "保存推送记录信息")
    public R save(@RequestBody BloodChargeUploadHistoryEntity bloodChargeUploadHistory){
		bloodChargeUploadHistoryService.save(bloodChargeUploadHistory);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @ControllerLogAnnotation(module = "收费模块", operate = "修改推送记录信息")
    public R update(@RequestBody BloodChargeUploadHistoryEntity bloodChargeUploadHistory){
		bloodChargeUploadHistoryService.updateById(bloodChargeUploadHistory);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @ControllerLogAnnotation(module = "收费模块", operate = "删除推送记录信息")
    public R delete(@RequestBody Integer[] ids){
		bloodChargeUploadHistoryService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
